# -*- coding: utf-8 -*-
# Version:python3.7
# Author:Jun Date:2021/1/8 18:21
import hmac
from hashlib import sha256
from odoo import models
from odoo . http import request
from odoo import api , http , models , tools , SUPERUSER_ID
ooo00oOo = [ 'ico' , 'png' , 'jpeg' , 'gif' , 'bmp' ]
oO0oOOOoOo = {
 "ico" : "image/x-icon" ,
 "png" : "image/png" ,
 "jpg" : "image/jpg" ,
 "gif" : "image/gif" ,
 "bmp" : "image/bmp" ,
 'tif' : "image/tiff" ,
 }
class O00oOooOo0 ( models . AbstractModel ) :
                                                                                                    _inherit = 'ir.http'
                                                                                                    if 60 - 60: I11i11II . oOo0oOoOoo0 % OOooO00oOO0 / iiIIi1
                                                                                                    def att_binary_img_content ( self , att_id , ext_name ) :
                                                                                                                                                                                                        II1I1111II = None
                                                                                                                                                                                                        IIi1I1iI11I = 404
                                                                                                                                                                                                        iII1 = 'image/png'
                                                                                                                                                                                                        o0o = oO0oOOOoOo . get ( ext_name , iII1 )
                                                                                                                                                                                                        O0oo0ooo0oOO = api . Environment ( request . cr , SUPERUSER_ID , request . context )
                                                                                                                                                                                                        II1I1111II = O0oo0ooo0oOO [ 'ir.attachment' ] . sudo ( ) . search ( [ ( 'id' , '=' , att_id ) ] )
                                                                                                                                                                                                        IIIiIIIIiIi11 , oOo , IIi1I1iI11I = None , [ ] , None
                                                                                                                                                                                                        if not II1I1111II :
                                                                                                                                                                                                                                                                                                            return ( IIi1I1iI11I or 404 , [ ] , None )
                                                                                                                                                                                                        IIi1I1iI11I , IIIiIIIIiIi11 , i11I1iiII , o0000O , Ii1I11I1iII11 = self . _binary_ir_attachment_redirect_content ( II1I1111II , default_mimetype = o0o )
                                                                                                                                                                                                        if not IIIiIIIIiIi11 :
                                                                                                                                                                                                                                                                                                            IIi1I1iI11I , IIIiIIIIiIi11 , i11I1iiII , o0000O , Ii1I11I1iII11 = self . _binary_record_content (
 II1I1111II , field = 'datas' , filename = i11I1iiII , filename_field = 'name' ,
 default_mimetype = 'application/octet-stream' )
                                                                                                                                                                                                        IIi1I1iI11I , oOo , IIIiIIIIiIi11 = self . _binary_set_headers (
 IIi1I1iI11I , IIIiIIIIiIi11 , i11I1iiII , o0000O , unique = None , filehash = Ii1I11I1iII11 , download = None )
                                                                                                                                                                                                        return IIi1I1iI11I , oOo , IIIiIIIIiIi11
# dd678faae9ac167bc83abf78e5cb2f3f0688d3a3